package com.yijiaganxi.product.openFeign;

import feign.QueryMap;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.*;
import org.yijiaganxi.common.GlobalConstants;
import org.yijiaganxi.common.entity.banner.YjgxBanner;
import org.yijiaganxi.common.res.R;


@Component
@FeignClient(value = "yijiaganxi-services",fallback = TestOpenFeignFallBack.class)
public interface TestOpenFeign {

    @GetMapping("queryTestGet1")
    public Object queryTestGet1();

    @GetMapping("queryTestGet2")
    public YjgxBanner queryTestGet2();

    @GetMapping("queryTestGet3")
    public Object queryTestGet3(@RequestParam("id")String id);

    @GetMapping("queryTestGet4")
    public YjgxBanner queryTestGet4(@RequestParam("id")String id);

    //Todo 复杂参数需要用 post请求
    @PostMapping("queryTestGet5")
    public YjgxBanner queryTestGet5(@RequestBody YjgxBanner banner);







    @PostMapping("queryTestPost1")
    public Object queryTestPost1();

    @PostMapping("queryTestPost2")
    public YjgxBanner queryTestPost2();

    @PostMapping("queryTestPost3")
    public Object queryTestPost3(@RequestParam("id")String id);

    @PostMapping("queryTestPost4")
    public YjgxBanner queryTestPost4(@RequestParam("id")String id);

    @PostMapping( value = "queryTestPost5",produces = "application/json")
    public R queryTestPost5(@RequestBody YjgxBanner banner);


    @PostMapping( value = "services/yjgxBanner/"+ GlobalConstants.WEB_FLAG+"/addBanner")
    public R addBanner(@RequestBody YjgxBanner banner);
}
